home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-02 | 5.3 KB | 175 lines | [TEXT/KAHL] |
- /**********************************************************************
- CQTPane.c
-
- Pane methods for the QuickTime demo application.
-
- Copyright © 1992 Joe Zobkiw. All rights reserved.
- Portions Copyright © 1990 Symantec Corporation. All rights reserved.
-
- Copyright © 1995 Gregory Bonk. All rights reserved.
- Changes upgrade to TPM 7.0.7
- *********************************************************************/
-
-
- // Most applications will want a scrollable window, so this
- // class is based on the class CPanorama. All the methods here
- // would still apply to classes based directly on CPane.
-
-
- #include "CQTPane.h"
- #include "Defines.h"
- #include "CMovie.h"
- #include "QuickTime Utilities.h"
- #include <CBartender.h>
-
- extern CBartender *gBartender; // The menu handling object
-
- TCL_DEFINE_CLASS_D1(CQTPane, CPanorama);
-
- /**** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ****/
-
- CQTPane::CQTPane()
- {
- TCL_END_CONSTRUCTOR
- }
-
-
- CQTPane::~CQTPane()
- {
- TCL_START_DESTRUCTOR
- }
-
-
- void CQTPane::IQTPane(CView *anEnclosure, CBureaucrat *aSupervisor, short aWidth, short aHeight,
- short aHEncl, short aVEncl,
- SizingOption aHSizing, SizingOption aVSizing,FSSpec *movieSpec)
- {
- CPanorama::IPanorama(anEnclosure, aSupervisor, aWidth, aHeight, aHEncl, aVEncl, aHSizing, aVSizing);
-
- SetWantsClicks(TRUE);
-
- // create our subpane to hold the movie
- itsMoviePane = new CMovie();
- itsMoviePane->IMovie(this, aSupervisor, aWidth, aHeight, aHEncl, aVEncl, aHSizing, aVSizing, movieSpec);
- }
-
- /**************************************************************************
- DoCommand
-
- This is the heart of your pane.
- In this method, you handle all the commands your pane deals with.
- *************************************************************************/
- void CQTPane::DoCommand(long theCommand)
- {
- switch (theCommand)
- {
- default:
- inherited::DoCommand(theCommand);
- break;
- }
- }
-
-
- /**************************************************************************
- UpdateMenus
-
- In this method you can enable menu commands that apply when
- your pane is active.
- *************************************************************************/
- void CQTPane::UpdateMenus()
- {
- inherited::UpdateMenus();
- }
-
- /**************************************************************************
- ImportMovie
-
- Import a movie into an existing document.
- *************************************************************************/
- void CQTPane::ImportMovie(FSSpec *spec)
- {
- itsMoviePane->ImportMovie(spec);
- }
-
- /**************************************************************************
- Draw
-
- In this method, you draw whatever you need to display in
- your pane. The area parameter gives the portion of the
- pane that needs to be redrawn. Area is in frame coordinates.
- *************************************************************************/
- void CQTPane::Draw(Rect *area)
- {
-
- }
-
-
- /**************************************************************************
- DoClick
-
- The mouse went down in the pane.
- In this method you do whatever is appropriate for your
- application. HitPt is given in frame coordinates. The other
- parameters, modiferKeys and when, are taken from the event
- record.
-
- If you want to implement mouse tracking, this is the method
- to do it in. You need to create a subclass of CMouseTask and
- pass it in a TrackMouse() message to the pane.
- *************************************************************************/
- void CQTPane::DoClick(Point hitPt, short modifierKeys, long when)
- {
-
- }
-
-
- /**************************************************************************
- HitSamePart
-
- Test whether pointA and pointB are in the same part.
- "The same part" means different things for different applications.
- In the default method, "the same part" means "in the same pane."
- If you want a different behavior, override this method. For instance,
- two points might be in the same part if they're within n pixels
- of each other.
-
- PointA and pointB are both in frame coordinates.
- *************************************************************************/
- Boolean CQTPane::HitSamePart(Point pointA, Point pointB)
- {
- return inherited::HitSamePart(pointA, pointB);
- }
-
-
- /**************************************************************************
- AdjustCursor
-
- If you want the cursor to have a different shape in your pane,
- do it in this method. If you want a different cursor for different
- parts of the same pane, you'll need to change the mouseRgn like this:
- 1. Create a region for the "special area" of your pane.
- 2. Convert this region to global coordinates
- 3. Set the mouseRgn to the intersection of this region
- and the original mouseRgn: SectRgn(mouseRgn, myRgn, mouseRgn);
-
- The default method just sets the cursor to the arrow. If this is fine
- for you, don't override this method.
- *************************************************************************/
- void CQTPane::AdjustCursor(Point where, RgnHandle mouseRgn)
- {
- inherited::AdjustCursor(where, mouseRgn);
- }
-
-
- /**************************************************************************
- ScrollToSelection
-
- If your pane is based on a Panorama (as this example is), you might
- want to define what it means to have a selection and what it means to
- scroll to that selection.
- *************************************************************************/
- void CQTPane::ScrollToSelection(void)
- {
- // scroll to the selection
- }
-